<template>
<span :class="wrapper_name">
  <button v-if="btns.to_sync" title="更新对应权限"
          class="ui circular icon primary button tiny"
          @click.stop.prevent="to_sync()">
          <i class="icon icon-gengxin"></i>
        </button>
</span>
</template>
<script type="text/ecmascript-6">
  import tool from 'src/util/tool';
  import util from '_util/index';
  import logic from '_logic';
  import in_array from 'in_array';

  import btn_group from 'components/common/btn_group';


  export default {
    data() {
      return {
      }
    },
    components: {
    },
    methods: {
      to_sync(){
          logic.list.checkIds(this, (selected_ids) => {
              util.showConfirm(this, () => {
                  let url = tool.getApi(this, 'Authority', 'auth_tpl_sync');
                  let param = {
                      id: selected_ids
                  };
                  util.http.SR(this, url, param, '更新成功');
              });
          },'请选择要更新的数据');


      },
    },
    computed: {
      ctl(){
        return this.$route.query.ctl;
      },
      is_admin(){
        return util.is_admin(this);
      },
    },
    props: ['wrapper_name','btns'],
    created() {
    },
  };
</script>
<style rel="stylesheet/less" lang="less">@dir: "header/";</style>
